﻿using System;
using System.Windows.Forms;

namespace BingSpatialDataServiceExcelAddin.Views
{
    public partial class UploadModal : Form
    {
        public UploadModal()
        {
            InitializeComponent();

            UploadPanel uPanel = new UploadPanel(this);
            Host.Child = uPanel;
        }

        //Disable Close Button
        private const int CP_NOCLOSE_BUTTON = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams myCp = base.CreateParams;
                myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
                return myCp;
            }
        }

        public void Show()
        {
            NativeWindow xlMain = new NativeWindow();
            xlMain.AssignHandle(new IntPtr(Globals.ThisAddIn.Application.Hwnd));

            this.ShowDialog(xlMain);
            this.Dispose();
            xlMain.ReleaseHandle();
        }
    }
}
